package com.cxrj.zhsq.partyMember.controller;

import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cxrj.zhsq.annotation.SystemControllerLog;
import com.cxrj.zhsq.partyMember.entity.PartyMemberMien;
import com.cxrj.zhsq.partyMember.service.PartyMemberMienService;

@Controller
@RequestMapping("/partyMemberMien")
public class PartyMemberMienController {
	
	@Resource
	private PartyMemberMienService memberMienService;
	
	/**
	 * 查询所有数据
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value="selectPartyMemberMienPage" ,method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	@ResponseBody
	public Map<String, Object> selectPartyMemberMienPage(HttpServletRequest request,HttpServletResponse response){
		return memberMienService.selectPartyMemberMienPage(request,response);
	}
	
	/**
	 * 根据ID查询
	 * @param mId
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping("selectPartyMemberMienById")
	@ResponseBody
	public Map<String, Object> selectPartyMemberMienById(String mId, HttpServletRequest request){
		return memberMienService.selectPartyMemberMienById(mId, request);
	}
	
	/**
	 * 添加党员风采
	 * @param memberMien
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping("insertPartyMemberMien")
	@SystemControllerLog(description = "添加党员风采")
	@ResponseBody
	public Map<String, Object> insertPartyMemberMien(PartyMemberMien memberMien,HttpServletRequest request ,HttpServletResponse response){
		return memberMienService.insertPartyMemberMien(memberMien,request,response);
	}
	
	/**
	 * 更新数据
	 * @param memberMien
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping("updatePartyMemberMien")
	@ResponseBody
	public Map<String, Object> updatePartyMemberMien(PartyMemberMien memberMien,HttpServletRequest request ,HttpServletResponse response){
		return memberMienService.updatePartyMemberMien(memberMien,request,response);
	}
	
	/**
	 * 发布状态
	 * @param memberMien
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping("updatePartyMemberMienState")
	@ResponseBody
	public Map<String, Object> updatePartyMemberMienState(PartyMemberMien memberMien,HttpServletRequest request ,HttpServletResponse response){
		return memberMienService.updatePartyMemberMienState(memberMien,request,response);
	}
	
	/**
	 * 删除数据
	 * @param mId
	 * @return
	 */
	@RequestMapping("deletePartyMemberMien")
	@SystemControllerLog(description = "删除党员风采")
	@ResponseBody
	public Map<String, Object> deletePartyMemberMien(String mId,HttpServletRequest request ,HttpServletResponse response){
		return memberMienService.deletePartyMemberMien(mId,request,response);
	}

}
